<template>
  <div>
    <!-- 列表区域 -->
    <section class="main">
      <ul class="todo-list">
        <li class="todo" v-for="item in list" :key="item.id">
          <div class="view">
            <span class="index">{{ item.id }}</span>
            <label>{{ item.name }}</label>
            <button class="destroy" @click="del(item.id)"></button>
          </div>
        </li>
      </ul>
    </section>
  </div>
</template>
<script>
export default {
  name: 'TodoMain',
  props: {
    list: Array
  },
  data () {
    return {

    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    del (id) {
      this.$emit('del', id)
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
